//
//  Base.h
//  SLBSMainKit
//
//  Created by CoderSLZeng on 2017/11/21.
//  Copyright © 2017年 CoderSLZeng. All rights reserved.
//

#ifndef Base_h
#define Base_h

/***********屏幕适配*************/
#define SLScreenW [UIScreen mainScreen].bounds.size.width
#define SLScreenH [UIScreen mainScreen].bounds.size.height

#define kInch5_8 (SLScreenH == 812) // iPhone X
#define kInch5_5 (SLScreenH == 736) // iPhone 6,6s,7,8 Plus
#define kInch4_7 (SLScreenH == 667) // iPhone 6,6s,7,8
#define kInch4 (SLScreenH == 568)  // iPhone 5,5c,5s,SE
#define kInch3_5 (SLScreenH == 480) // iPhone 4和之前的机型

/*** 评论-头部控件-字体 ***/
#define SLCommentSectionHeaderFont [UIFont systemFontOfSize:15]

/**** weak/strongOBJ ****/
#define SLWeakObj(o) autoreleasepool{} __weak typeof(o) o##Weak = o;
#define SLStrongObj(o) autoreleasepool{} __strong typeof(o) o = o##Weak;

/*** 当前系统版本判断 ***/
#define iOS(version) ([UIDevice currentDevice].systemVersion.doubleValue >= (version))

/*** 将服务器返回的数据写入plist ***/
#define SLWriteToPlist(data, filename) [data writeToFile:[NSString stringWithFormat:@"/Users/Anthony/Desktop/%@.plist", filename] atomically:YES];

/*** 日志 ***/
#ifdef DEBUG
#define SLLog(...) NSLog(__VA_ARGS__)
#define SLLogFunc SLLog(@"%s", __func__);
#else
#define SLLog(...)
#define SLLogFunc
#endif

/*** 颜色 ***/
#define SLColorA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]
#define SLColor(r, g, b) SLColorA((r), (g), (b), 255)
#define SLRandomColor SLColor(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))
#define SLrayColor(v) SLColor((v), (v), (v))
#define SLCommonBgColor SLrayColor(206)

#endif /* Base_h */
